<?php
/**
 * Flea Site
 *
 * @copyright  Copyright (c) 2008 Movoin Studio (http://movoin.com)
 * @license    Apache License 2.0
 * @version    $Id: GuestbookWrite.php 138 2009-05-25 06:42:38Z movoin $
 */

function _ctlGuestbookWrite($name, $args=null)
{
    $opts = array('url');
    $data = FLEA_WebControls::extractAttribs($args, $opts);
    FLEA_WebControls::mergeAttribs($args);

    if(!$data['url'])
        $data['url'] = url($name, 'save');

    $output .= "<style type=\"text/css\">\n";
    $output .= ".gb-write {}\n";
    $output .= ".gb-write label { color:#333; padding-top:10px; display:block; }\n";
    $output .= ".gb-write textarea { width:100%; border:1px #ccc solid; height:140px; }\n";
    $output .= ".gb-write table { width:100%; margin-top:8px; }\n";
    $output .= ".gb-write input[type=\"text\"] { width:98%; border:1px #ccc solid; height:20px; line-height:20px; }\n";
    $output .= ".gb-write input[type=\"submit\"] { width:120px; border:1px #ccc solid; height:30px; line-height:30px; margin-top:12px; }\n";
    $output .= ".gb-write .tips {}\n";
    $output .= ".gb-write .tips p { line-height:1.6; font-size:13px;}\n";
    $output .= ".gb-write .tips ol { background:#fbfbfb; padding-top:12px; padding-bottom:12px; }\n";
    $output .= ".gb-write .hr { display:block; height:1px; background:#ccc; margin:15px 0; }\n";
    $output .= "</style>\n";
    $output .= "<div class=\"gb-write\">\n";
    $output .= "<div class=\"tips\">\n";
    $output .= "<p class=\"b\">尊贵的朋友，您好！</p>\n";
    $output .= "<p>为了不断改善和了解我们需要关注的问题，并且针对您的反馈信息采取必要的措施，您的反馈结果将会提供给所有员工，以改善我们提供的产品、服务和支持。</p>\n";
    $output .= "<ol>\n";
    $output .= "<li>售前、售后服务客户反馈</li>\n";
    $output .= "<li>对我司工作人员不合理行为投诉</li>\n";
    $output .= "<li>意见和建议</li>\n";
    $output .= "</ol>\n";
    $output .= "<p>注意：提交的留言并不能立即在留言列表中显示，需经过管理员审核后才能在留言列表显示。</p>\n";
    $output .= "</div>\n";
    $output .= "<span class=\"hr\"></span>\n";
    $output .= "<form action=\"" . $data['url'] . "\" method=\"post\">\n";
    $output .= "<table>\n";
    $output .= "<tr>\n";
    $output .= "<td style=\"width:33.33%\"><label for=\"username\">姓名：</label></td>\n";
    $output .= "<td style=\"width:33.34%\"><label for=\"tel\">联系电话：</label></td>\n";
    $output .= "<td style=\"width:33.33%\"><label for=\"email\">联系邮箱：</label></td>\n";
    $output .= "</tr>\n";
    $output .= "<tr>\n";
    $output .= "<td><input type=\"text\" id=\"username\" name=\"username\" value=\"\" /></td>\n";
    $output .= "<td><input type=\"text\" id=\"tel\" name=\"tel\" value=\"\" /></td>\n";
    $output .= "<td><input type=\"text\" id=\"email\" name=\"email\" value=\"\" /></td>\n";
    $output .= "</tr>\n";
    $output .= "</table>\n";
    $output .= "<p class=\"mtop\"><label for=\"content\">留言内容：</label></p>\n";
    $output .= "<p><textarea id=\"content\" name=\"content\"></textarea></p>\n";
    $output .= "<p><input type=\"submit\" value=\"提交留言\" /></p>\n";
    $output .= "</form>\n";
    $output .= "</div>\n";

    return $output;
}
